1. Field of the Invention
The present invention relates generally to data transfers over an I/O bus, and more particularly, to Packetized SCSI Protocol Data transfers.
2. Description of Related Art
Prior to the Packetized SCSI Protocol, the SCSI Protocol utilized the well-known SCSI bus phases, Message Out, Message In, Command, Data Out, Data In, and Status to exchange information and data between a SCSI initiator and a SCSI target over a SCSI bus. Performance improvements throughout the revisions of the SCSI Protocol have been primarily in the data phases. Consequently, information can be transferred between the SCSI initiator and the SCSI target at a very much higher rate in the data phases than in any of the other SCSI phases.
To capitalize on the higher data throughput during the SCSI data phases, the Packetized SCSI Protocol specifies that all information exchanged between a SCSI initiator and a SCSI target is done via packets, called information units (IU), in either the Data In or the Data Out phases exclusively. Originally, each data packet, referred to herein as a data packet information unit, was immediately preceded by a header packet, referred to herein as a header packet information unit. The header packet information unit contained information about the immediately following data packet information unit, such as the length of the data packet information unit.
According to the Packetized SCSI Protocol, data transfers from a SCSI initiator, sometimes referred to as initiator, to a SCSI target, sometimes referred to as target, were initiated by the target transferring a header packet information unit to the initiator via the Data In phase. The header packet information unit was basically a request by the target for the initiator to fetch data from the host for transfer to the target. After sending the header packet information unit, the target switched the SCSI bus phase to Data Out and awaited the data.
Data transfers from the target to the initiator were also initiated by the target transferring a header packet information unit to the initiator via the Data In phase. This header packet information unit basically was a request by the target for the initiator to prepare the initiator's data path for transfer of data from the target to the host system. After sending the header packet information unit, the target remained in the SCSI bus phase Data In and immediately after sending the header packet information unit could start transferring data to the initiator.
The target sometimes broke a data transfer up into multiple data packet information units, for example, to facilitate target buffer management. For example, at the beginning of a 16 Kbytes data transfer from the initiator to the target, the target may have had only 4 Kbytes of buffer space available to receive data. In this case, the target first transferred a header packet information unit in the Data In phase that specified a data packet information unit length of 4 Kbytes, and then changed the SCSI bus phase to Data Out to receive the 4 Kbytes of data from the initiator.
During the transfer of the data packet information unit, the target may have realized that another 4 Kbytes of buffer space had become available to receive data. At the end of the first 4 Kbytes data packet information unit, the target changed the SCSI bus phase back to Data In, and sent the initiator another header information packet unit requesting another 4 Kbytes of data, and then changed the SCSI bus phase back to Data Out to receive more data.
Similarly, a target could break data transfers from the target to the initiator up into multiple data packet information units with each data packet information unit preceded by a header packet information unit. In this case, the target kept the SCSI bus phase in Data In throughout the transfers.
The transfer of each header packet information unit is purely administrative overhead, and so consumes SCSI bus bandwidth. Likewise, switches between the Data In and Data Out SCSI bus phases are very costly in time. Since performance could be significantly improved by reducing the number of header packet information units and the number of SCSI bus phase changes, the Packetized SCSI Protocol incorporated data streaming.
Data streaming in the Packetized SCSI Protocol is representing multiple data packet information units using a single header packet information unit. Unfortunately, this data streaming is applicable only for data transfers from the initiator to the target. As described above, without streaming, the initiator always expected the target to change the SCSI bus phase to Data In after receiving a data packet information unit in the Data Out phase.
With data streaming, a target signals a data streaming request by remaining in the Data Out phase after receiving a data packet information unit. This signal tells the initiator to reuse the header packet information unit previously received from the initiator to transfer another data packet information unit to the target. This data-streaming scheme eliminated transfer of header packet information units between data packet information units in some situations, and also eliminated the associated SCSI bus phase changes from Data Out to Data In and back to Data Out for transfers from the initiator to the target.
According to the Packetized SCSI Protocol, there is no data streaming for data transfers from the target to the initiator. While several schemes have been proposed for streaming in this direction, all had poor performance and so were not adopted.
While the Packetized SCSI Protocol data streaming does reduce overhead for transfers in one direction, the data streaming does not provide the initiator any information that helps in prefetching data from the host. To maximize performance, the initiator must always have data in its data path. If the initiator waited for a request for data from a target before requesting data from the host, a very large delay would be incurred on the SCSI bus. To eliminate this delay, the initiator assumed data streaming to the target.
Although the initiator anticipated the end of a data packet information unit based upon the length, the initiator prefetched additional data from the host to be ready in the event that the target signaled a request for another data packet information unit. If the target failed to signal such a request, the prefetched data was wasted, and would have to be fetched again. Consequently, the host bus utilization was affected by the wasted prefetching and refetching. Thus, while data streaming did eliminate some SCSI bus overhead, it did not address optimizing system performance including host bus utilization.